package com.yazi.mxz.common.entity.beans;

import com.myframework.smhj.hibernate.Entity;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.SEQUENCE;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * Region entity. @author MyEclipse Persistence Tools
 */
@javax.persistence.Entity
@Table(name = "MXZ_REGION", schema = "MXZ")
public class Region extends Entity implements java.io.Serializable {

	// Fields

	private Long regionId;
	private Long parentId;
	private String name;
	private Integer type;
	private String lnglat;
	private String spell;
	private String cityCode;
	private String zipCode;
	private String ads;
	private String words;
	private Integer coverType;
	private Long updateTime;
	private Set<Address> addresses = new HashSet<Address>(0);
	private Set<StoreRegion> storeRegions = new HashSet<StoreRegion>(0);
	private Set<Store> stores = new HashSet<Store>(0);

	// Constructors

	/** default constructor */
	public Region() {
	}

	/** minimal constructor */
	public Region(Long parentId, String name, Integer type, Integer coverType,
			Long updateTime) {
		this.parentId = parentId;
		this.name = name;
		this.type = type;
		this.coverType = coverType;
		this.updateTime = updateTime;
	}

	/** full constructor */
	public Region(Long parentId, String name, Integer type, String lnglat,
			String spell, String cityCode, String zipCode, String ads,
			String words, Integer coverType, Long updateTime,
			Set<Address> addresses, Set<StoreRegion> storeRegions,
			Set<Store> stores) {
		this.parentId = parentId;
		this.name = name;
		this.type = type;
		this.lnglat = lnglat;
		this.spell = spell;
		this.cityCode = cityCode;
		this.zipCode = zipCode;
		this.ads = ads;
		this.words = words;
		this.coverType = coverType;
		this.updateTime = updateTime;
		this.addresses = addresses;
		this.storeRegions = storeRegions;
		this.stores = stores;
	}

	// Property accessors
	@SequenceGenerator(name = "generator", sequenceName = "SEQ_REGION")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "REGION_ID", unique = true, nullable = false, precision = 15, scale = 0)
	public Long getRegionId() {
		return this.regionId;
	}

	public void setRegionId(Long regionId) {
		this.regionId = regionId;
	}

	@Column(name = "PARENT_ID", nullable = false, precision = 15, scale = 0)
	public Long getParentId() {
		return this.parentId;
	}

	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}

	@Column(name = "NAME", nullable = false, length = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "TYPE", nullable = false, precision = 8, scale = 0)
	public Integer getType() {
		return this.type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@Column(name = "LNGLAT", length = 30)
	public String getLnglat() {
		return this.lnglat;
	}

	public void setLnglat(String lnglat) {
		this.lnglat = lnglat;
	}

	@Column(name = "SPELL", length = 150)
	public String getSpell() {
		return this.spell;
	}

	public void setSpell(String spell) {
		this.spell = spell;
	}

	@Column(name = "CITY_CODE", length = 10)
	public String getCityCode() {
		return this.cityCode;
	}

	public void setCityCode(String cityCode) {
		this.cityCode = cityCode;
	}

	@Column(name = "ZIP_CODE", length = 10)
	public String getZipCode() {
		return this.zipCode;
	}

	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}

	@Column(name = "ADS", length = 1000)
	public String getAds() {
		return this.ads;
	}

	public void setAds(String ads) {
		this.ads = ads;
	}

	@Column(name = "WORDS", length = 1000)
	public String getWords() {
		return this.words;
	}

	public void setWords(String words) {
		this.words = words;
	}

	@Column(name = "COVER_TYPE", nullable = false, precision = 8, scale = 0)
	public Integer getCoverType() {
		return this.coverType;
	}

	public void setCoverType(Integer coverType) {
		this.coverType = coverType;
	}

	@Column(name = "UPDATE_TIME", nullable = false, precision = 15, scale = 0)
	public Long getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Long updateTime) {
		this.updateTime = updateTime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "region")
	public Set<Address> getAddresses() {
		return this.addresses;
	}

	public void setAddresses(Set<Address> addresses) {
		this.addresses = addresses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "region")
	public Set<StoreRegion> getStoreRegions() {
		return this.storeRegions;
	}

	public void setStoreRegions(Set<StoreRegion> storeRegions) {
		this.storeRegions = storeRegions;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "region")
	public Set<Store> getStores() {
		return this.stores;
	}

	public void setStores(Set<Store> stores) {
		this.stores = stores;
	}

}